package com.jyw.system.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import com.jyw.system.mapper.SysUserDeptMapper;
import com.jyw.system.domain.SysUserDept;
import com.jyw.system.service.ISysUserDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;

/**
 * 用户和部门关联Service业务层处理
 * 
 * @author system
 * @date 2023-08-09
 */
@Service
public class SysUserDeptServiceImpl extends ServiceImpl<SysUserDeptMapper,SysUserDept> implements ISysUserDeptService
{
    @Resource
    private SysUserDeptMapper sysUserDeptMapper;

    /**
     * 查询用户和部门关联
     * 
     * @param id 用户和部门关联主键
     * @return 用户和部门关联
     */
    @Override
    public SysUserDept selectSysUserDeptById(Long id)
    {
        return sysUserDeptMapper.selectSysUserDeptById(id);
    }

    /**
     * 查询用户和部门关联列表
     * 
     * @param sysUserDept 用户和部门关联
     * @return 用户和部门关联
     */
    @Override
    public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
    }

    /**
     * 新增用户和部门关联
     * 
     * @param sysUserDept 用户和部门关联
     * @return 结果
     */
    @Override
    public int insertSysUserDept(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.insertSysUserDept(sysUserDept);
    }

    /**
     * 修改用户和部门关联
     * 
     * @param sysUserDept 用户和部门关联
     * @return 结果
     */
    @Override
    public int updateSysUserDept(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.updateSysUserDept(sysUserDept);
    }

    /**
     * 批量删除用户和部门关联
     * 
     * @param ids 需要删除的用户和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteSysUserDeptByIds(Long[] ids)
    {
        return sysUserDeptMapper.deleteSysUserDeptByIds(ids);
    }

    /**
     * 删除用户和部门关联信息
     * 
     * @param id 用户和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteSysUserDeptById(Long id)
    {
        return sysUserDeptMapper.deleteSysUserDeptById(id);
    }
}
